/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "zookeeper.jute.h"
#include <linux/kernel.h>

int serialize_op_result_t(struct oarchive *out, const char *tag, struct op_result_t *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "rc", &v->rc);
    rc = rc ? : out->serialize_Int(out, "op", &v->op);
    rc = rc ? : out->serialize_Buffer(out, "response", &v->response);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_op_result_t(struct iarchive *in, const char *tag, struct op_result_t*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "rc", &v->rc);
    rc = rc ? : in->deserialize_Int(in, "op", &v->op);
    rc = rc ? : in->deserialize_Buffer(in, "response", &v->response);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_op_result_t(struct op_result_t*v){
    deallocate_Buffer(&v->response);
}
int serialize_ConnectRequest(struct oarchive *out, const char *tag, struct ConnectRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "lastZxidSeen", &v->lastZxidSeen);
    rc = rc ? : out->serialize_Int(out, "timeOut", &v->timeOut);
    rc = rc ? : out->serialize_Long(out, "sessionId", &v->sessionId);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_ConnectRequest(struct iarchive *in, const char *tag, struct ConnectRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "lastZxidSeen", &v->lastZxidSeen);
    rc = rc ? : in->deserialize_Int(in, "timeOut", &v->timeOut);
    rc = rc ? : in->deserialize_Long(in, "sessionId", &v->sessionId);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_ConnectRequest(struct ConnectRequest*v){
}
int serialize_ConnectResponse(struct oarchive *out, const char *tag, struct ConnectResponse *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "timeOut", &v->timeOut);
    rc = rc ? : out->serialize_Long(out, "sessionId", &v->sessionId);
    rc = rc ? : out->serialize_Int(out, "cxid", &v->cxid);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_ConnectResponse(struct iarchive *in, const char *tag, struct ConnectResponse*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "timeOut", &v->timeOut);
    rc = rc ? : in->deserialize_Long(in, "sessionId", &v->sessionId);
    rc = rc ? : in->deserialize_Int(in, "cxid", &v->cxid);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_ConnectResponse(struct ConnectResponse*v){
}
int serialize_RequestHeader(struct oarchive *out, const char *tag, struct RequestHeader *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "xid", &v->xid);
    rc = rc ? : out->serialize_Int(out, "nonce", &v->nonce);
    rc = rc ? : out->serialize_Int(out, "type", &v->type);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_RequestHeader(struct iarchive *in, const char *tag, struct RequestHeader*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "xid", &v->xid);
    rc = rc ? : in->deserialize_Int(in, "nonce", &v->nonce);
    rc = rc ? : in->deserialize_Int(in, "type", &v->type);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_RequestHeader(struct RequestHeader*v){
}
int serialize_ReplyHeader(struct oarchive *out, const char *tag, struct ReplyHeader *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "xid", &v->xid);
    rc = rc ? : out->serialize_Int(out, "nonce", &v->nonce);
    rc = rc ? : out->serialize_Int(out, "type", &v->type);
    rc = rc ? : out->serialize_Long(out, "zxid", &v->zxid);
    rc = rc ? : out->serialize_Int(out, "err", &v->err);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_ReplyHeader(struct iarchive *in, const char *tag, struct ReplyHeader*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "xid", &v->xid);
    rc = rc ? : in->deserialize_Int(in, "nonce", &v->nonce);
    rc = rc ? : in->deserialize_Int(in, "type", &v->type);
    rc = rc ? : in->deserialize_Long(in, "zxid", &v->zxid);
    rc = rc ? : in->deserialize_Int(in, "err", &v->err);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_ReplyHeader(struct ReplyHeader*v){
}
int serialize_GetDataRequest(struct oarchive *out, const char *tag, struct GetDataRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_GetDataRequest(struct iarchive *in, const char *tag, struct GetDataRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_GetDataRequest(struct GetDataRequest*v){
}
int serialize_BoloskyGetDataRequest(struct oarchive *out, const char *tag, struct BoloskyGetDataRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->serialize_Int(out, "serverId", &v->serverId);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_BoloskyGetDataRequest(struct iarchive *in, const char *tag, struct BoloskyGetDataRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->deserialize_Int(in, "serverId", &v->serverId);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_BoloskyGetDataRequest(struct BoloskyGetDataRequest*v){
}
int serialize_SetDataRequest(struct oarchive *out, const char *tag, struct SetDataRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_SetDataRequest(struct iarchive *in, const char *tag, struct SetDataRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_SetDataRequest(struct SetDataRequest*v){
    deallocate_Buffer(&v->data);
}
int serialize_PrepareDataRequest(struct oarchive *out, const char *tag, struct PrepareDataRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "clientId", &v->clientId);
    rc = rc ? : out->serialize_Int(out, "count", &v->count);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_PrepareDataRequest(struct iarchive *in, const char *tag, struct PrepareDataRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "clientId", &v->clientId);
    rc = rc ? : in->deserialize_Int(in, "count", &v->count);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_PrepareDataRequest(struct PrepareDataRequest*v){
    deallocate_Buffer(&v->data);
}
int serialize_SyncRequest(struct oarchive *out, const char *tag, struct SyncRequest *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_SyncRequest(struct iarchive *in, const char *tag, struct SyncRequest*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_SyncRequest(struct SyncRequest*v){
}
int serialize_SyncResponse(struct oarchive *out, const char *tag, struct SyncResponse *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_SyncResponse(struct iarchive *in, const char *tag, struct SyncResponse*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_SyncResponse(struct SyncResponse*v){
}
int serialize_GetDataResponse(struct oarchive *out, const char *tag, struct GetDataResponse *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_GetDataResponse(struct iarchive *in, const char *tag, struct GetDataResponse*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_GetDataResponse(struct GetDataResponse*v){
    deallocate_Buffer(&v->data);
}
int serialize_BoloskyGetDataResponse(struct oarchive *out, const char *tag, struct BoloskyGetDataResponse *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_BoloskyGetDataResponse(struct iarchive *in, const char *tag, struct BoloskyGetDataResponse*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_BoloskyGetDataResponse(struct BoloskyGetDataResponse*v){
    deallocate_Buffer(&v->data);
}
int serialize_QuorumPacket(struct oarchive *out, const char *tag, struct QuorumPacket *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "type", &v->type);
    rc = rc ? : out->serialize_Long(out, "zxid", &v->zxid);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_QuorumPacket(struct iarchive *in, const char *tag, struct QuorumPacket*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "type", &v->type);
    rc = rc ? : in->deserialize_Long(in, "zxid", &v->zxid);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_QuorumPacket(struct QuorumPacket*v){
    deallocate_Buffer(&v->data);
}
int serialize_FileHeader(struct oarchive *out, const char *tag, struct FileHeader *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "magic", &v->magic);
    rc = rc ? : out->serialize_Int(out, "version", &v->version);
    rc = rc ? : out->serialize_Long(out, "dbid", &v->dbid);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_FileHeader(struct iarchive *in, const char *tag, struct FileHeader*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "magic", &v->magic);
    rc = rc ? : in->deserialize_Int(in, "version", &v->version);
    rc = rc ? : in->deserialize_Long(in, "dbid", &v->dbid);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_FileHeader(struct FileHeader*v){
}
int serialize_TxnHeader(struct oarchive *out, const char *tag, struct TxnHeader *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "clientId", &v->clientId);
    rc = rc ? : out->serialize_Int(out, "cxid", &v->cxid);
    rc = rc ? : out->serialize_Int(out, "nonce", &v->nonce);
    rc = rc ? : out->serialize_Long(out, "zxid", &v->zxid);
    rc = rc ? : out->serialize_Long(out, "time", &v->time);
    rc = rc ? : out->serialize_Int(out, "type", &v->type);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_TxnHeader(struct iarchive *in, const char *tag, struct TxnHeader*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "clientId", &v->clientId);
    rc = rc ? : in->deserialize_Int(in, "cxid", &v->cxid);
    rc = rc ? : in->deserialize_Int(in, "nonce", &v->nonce);
    rc = rc ? : in->deserialize_Long(in, "zxid", &v->zxid);
    rc = rc ? : in->deserialize_Long(in, "time", &v->time);
    rc = rc ? : in->deserialize_Int(in, "type", &v->type);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_TxnHeader(struct TxnHeader*v){
}
int serialize_SetDataTxn(struct oarchive *out, const char *tag, struct SetDataTxn *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "sessionId", &v->sessionId);
    rc = rc ? : out->serialize_Long(out, "blockId", &v->blockId);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_SetDataTxn(struct iarchive *in, const char *tag, struct SetDataTxn*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "sessionId", &v->sessionId);
    rc = rc ? : in->deserialize_Long(in, "blockId", &v->blockId);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_SetDataTxn(struct SetDataTxn*v){
    deallocate_Buffer(&v->data);
}
int serialize_PrepareDataTxn(struct oarchive *out, const char *tag, struct PrepareDataTxn *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Long(out, "sessionId", &v->sessionId);
    rc = rc ? : out->serialize_Int(out, "xid", &v->xid);
    rc = rc ? : out->serialize_Buffer(out, "data", &v->data);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_PrepareDataTxn(struct iarchive *in, const char *tag, struct PrepareDataTxn*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Long(in, "sessionId", &v->sessionId);
    rc = rc ? : in->deserialize_Int(in, "xid", &v->xid);
    rc = rc ? : in->deserialize_Buffer(in, "data", &v->data);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_PrepareDataTxn(struct PrepareDataTxn*v){
    deallocate_Buffer(&v->data);
}
int serialize_ErrorTxn(struct oarchive *out, const char *tag, struct ErrorTxn *v){
    int rc;
    rc = out->start_record(out, tag);
    rc = rc ? : out->serialize_Int(out, "err", &v->err);
    rc = rc ? : out->end_record(out, tag);
    return rc;
}
int deserialize_ErrorTxn(struct iarchive *in, const char *tag, struct ErrorTxn*v){
    int rc;
    rc = in->start_record(in, tag);
    rc = rc ? : in->deserialize_Int(in, "err", &v->err);
    rc = rc ? : in->end_record(in, tag);
    return rc;
}
void deallocate_ErrorTxn(struct ErrorTxn*v){
}
